import Vue from 'vue'
import Router from 'vue-router'

import Login from '@/pages/user/login'
import Home from '@/pages/home/home'

import Index from '@/pages/home/item/index'//首页
import Relation from '@/pages/home/item/relation'//关联客户
import Order from '@/pages/home/item/order'//有效订单
import CustomerList from '@/pages/home/item/CustomerList'//推广记录
import Recommendation from '@/pages/user/recommendation'//推荐页面



Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path:'/recommendation',
      name:'Recommendation',
      component:Recommendation
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children:[
        { 
          path:'/home/index',
          name:'Index',
          component:Index,
          meta:{
            id:1,
          }
        },
        { 
          path:'/home/relation',
          name:'Relation',
          component:Relation,
          meta:{
            id:2,
          }
        },
        { 
          path:'/home/order',
          name:'Order',
          component:Order,
          meta:{
            id:3,
          }
        },
        // { 
        //   path:'/home/promotionRecord',
        //   name:'PromotionRecord',
        //   component:PromotionRecord,
        //   meta:{
        //     id:4,
        //   }
        // },
        { 
          path:'/home/customerList',
          name:'CustomerList',
          component:CustomerList  ,
          meta:{
            id:4,
          }
        },
      ],redirect:'/home/index'
    },
    
  ]
})
